const jcore = require('./jcore');
const validate = require('./validate');

/**
 * 返回成功
 * @param {any} data 
 * @returns 
 */
 function resSuccess(data) {
  return {
      code: 0,
      data,
      message: '操作成功!'
  }
}
/**
* 返回失败
* @param {string} message 
* @param {number} code 
* @returns 
*/
function resError(message, code = 100) {
  return { code, message }
}

module.exports = {
  jcore,
  validate,
  resSuccess,
  resError
}